package com.cy.pj.goods.dao;

import com.cy.pj.goods.pojo.Goods;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface GoodsDao {
    List<Goods> findGoods();

    @Delete("delete from tb_goods where id=#{id}")
    int deleteById(Integer id);
    @Insert("insert into tb_goods (name,remark,createdTime) values (#{name},#{remark},now())")
    int insertGoods(Goods goods);
    @Select("select * from tb_goods where id=#{id}")
    Goods findById(Integer id);
    @Update("update tb_goods set name=#{name},remark=#{remark} where id=#{id}")
    void updateGoods(Goods goods);

    List<Goods> findObject(String name);

}
